﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/User.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<VERKProjectHopur16.Models.Picture>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Timeline
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Timeline</h2>

    <div>
        <input type="button" onclick="document.location.href = '<%: Url.Action("Upload", new { id = ViewData["ChildID"] }) %>'" value="Upload Pictures" />
    </div>
        <!-- Implied globalization ftw -->
        <script type="text/javascript">var List = {};</script>
        
        <div id="gallerya">
           <ul class="gallery-list" style="float: right; width: 150px; list-style: none;">
        <% foreach (var item in Model)
           {
               var ThumbPath = Url.Content("~/Content/Images/Thumb/" + item.PictureID + ".jpg");
               var FullPath  = Url.Content("~/Content/Images/Full/" + item.PictureID + ".jpg");
        %>
                <!-- Preloading, ignore this -->
                <p style="display: none;"><img alt="hehe" src="<%: ThumbPath %>" /></p>

                <li>
                    <a href="<%: FullPath %>" class="timeline" title="<%: item.PictureText %>" id="content-<%: item.PictureID %>" ><%: item.Name %> - <%: item.PictureDate.ToString("dd MMMM yyyy") %></a>
                    <%--<%: Html.ActionLink("Edit", "EditPicture", new { id = item.PictureID }) %>--%>
                </li>

                <!-- Add to Javascript List, and no, I don't know how to echo it in JSON format .. :( -->
                <script type="text/javascript">List["info-<%:item.PictureID %>"] = { FullPath: "<%: FullPath %>", ThumbPath: "<%:ThumbPath %>", PictureData:"<%: item.PictureText %>" };</script>
        <% } %>
            </ul>

            <div id="image-container"></div>
        </div>

</asp:Content>
